package com.ruoyi.appuser.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.appuser.domain.AppuserVipRecord;
import com.ruoyi.appuser.mapper.AppuserVipRecordMapper;
import com.ruoyi.appuser.service.IAppuserVipRecordService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 会员记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@Service
public class AppuserVipRecordServiceImpl extends ServiceImpl<AppuserVipRecordMapper,AppuserVipRecord> implements IAppuserVipRecordService
{
    @Resource
    private AppuserVipRecordMapper appuserVipRecordMapper;

    /**
     * 查询会员记录
     *
     * @param id 会员记录主键
     * @return 会员记录
     */
    @Override
    public AppuserVipRecord selectAppuserVipRecordById(String id)
    {
        return appuserVipRecordMapper.selectAppuserVipRecordById(id);
    }

    /**
     * 查询会员记录列表
     *
     * @param appuserVipRecord 会员记录
     * @return 会员记录
     */
    @Override
    public List<AppuserVipRecord> selectAppuserVipRecordList(AppuserVipRecord appuserVipRecord)
    {
        return appuserVipRecordMapper.selectAppuserVipRecordList(appuserVipRecord);
    }

    /**
     * 新增会员记录
     *
     * @param appuserVipRecord 会员记录
     * @return 结果
     */
    @Override
    public int insertAppuserVipRecord(AppuserVipRecord appuserVipRecord)
    {
        appuserVipRecord.setCreateTime(DateUtils.getNowDate());
        return appuserVipRecordMapper.insertAppuserVipRecord(appuserVipRecord);
    }

    /**
     * 修改会员记录
     *
     * @param appuserVipRecord 会员记录
     * @return 结果
     */
    @Override
    public int updateAppuserVipRecord(AppuserVipRecord appuserVipRecord)
    {
        return appuserVipRecordMapper.updateAppuserVipRecord(appuserVipRecord);
    }

    /**
     * 批量删除会员记录
     *
     * @param ids 需要删除的会员记录主键
     * @return 结果
     */
    @Override
    public int deleteAppuserVipRecordByIds(String[] ids)
    {
        return appuserVipRecordMapper.deleteAppuserVipRecordByIds(ids);
    }

    /**
     * 删除会员记录信息
     *
     * @param id 会员记录主键
     * @return 结果
     */
    @Override
    public int deleteAppuserVipRecordById(String id)
    {
        return appuserVipRecordMapper.deleteAppuserVipRecordById(id);
    }
}
